#include <iostream>
#include <set>
#include <fstream>
#include <string>

using namespace std;

int main(int argc, char* argv[])
{
	if(3 != argc)
	{
		cout<<"wrong paramter\n";
		return -1;
	}

	ifstream infile;
	ofstream outfile;

	infile.open(argv[1]);
	if( !infile)
	{
		cout<<"can'y open source file\n";
		return -1;
	}
	set<string> lines;
	string line;

	while(infile>>line)
	{
		lines.insert(line);
	}
	
	outfile.open(argv[2]);
	set<string>::iterator itor;
	for(itor=lines.begin(); itor != lines.end(); itor++)
	{
		outfile<<*itor<<endl;
	}

	
}
